# -*- coding: utf-8 -*-
"""
__author__ = 'bingo'
__date__ = '2019/2/24'
# code is far away from bugs with the god animal protecting
    I love animals. They taste delicious.
              ┏┓      ┏┓
            ┏┛┻━━━┛┻┓
            ┃      ☃      ┃
            ┃  ┳┛  ┗┳  ┃
            ┃      ┻      ┃
            ┗━┓      ┏━┛
                ┃      ┗━━━┓
                ┃  神兽保佑    ┣┓
                ┃　永无BUG！   ┏┛
                ┗┓┓┏━┳┓┏┛
                  ┃┫┫  ┃┫┫
                  ┗┻┛  ┗┻┛
"""
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.urls import reverse
from django.views import generic, View
from news.models import Tag


class IndexView(View):
    """
    发生页面重定向至首页
    """
    def get(self,request):
        return redirect(reverse('news:index'))


# class IndexView(generic.ListView):
#
#     """
#     官方推荐写法
#     """
#     template_name = 'news/index.html'
#     context_object_name = 'tags'
#     def get_queryset(self):
#         return Tag.objects.only('name').filter(is_delete=False).all()

